package com.my.demo.controller;

import com.my.demo.pojo.Employee;
import com.my.demo.service.EmployeeService;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 林允
 * @version 1.0
 * @description: TODO
 * @date 2023/5/23 21:15
 */
@Controller
public class EmployeeController {

    @Resource
    private EmployeeService employeeService;

    @RequestMapping(value = "/employee", method = RequestMethod.GET)
    @ResponseBody
    public List<Employee> getAll(){
       List<Employee> employeeList = employeeService.getAllEmployee();
       return employeeList;
    }


}
